from django.db import models
from django.contrib.auth.models import AbstractUser
from db.models import BaseModel


class User(AbstractUser, BaseModel):
    """自定义用户模型类"""

    mobile = models.CharField(max_length=11, unique=True, verbose_name='手机号')
    address = models.CharField(max_length=128, null=True, blank=True, verbose_name='默认地址')
    avatar = models.ImageField(upload_to="", default='image/default.png', max_length=150)
    gender = models.BooleanField(default=False, verbose_name="性别")
    motto = models.CharField(max_length=32, verbose_name="格言")
    bgWall = models.ImageField(upload_to="", default='image/default.png', verbose_name='背景墙')

    class Meta:
        db_table = 'tb_user'
        verbose_name = '用户'
        verbose_name_plural = verbose_name
